home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
AMICUS
/
AMIBEST2.ADF
/
Best of AMICUS 2
/
C
/
COMAL.H
< prev
next >
Wrap
Text File
|
1987-07-22
|
3KB
|
133 lines
Figure 1
COMAL.H LISTING
/* This include file defines some constructs similar to COMAL */
/* It also defines easily understood mathematical operators */
/* Logical operators */
#define AND && /* logical AND */
#define OR || /* logical OR */
#define NOT ! /* logical NOT */
#define EQ == /* equal value comparison */
#define NE != /* not equal value comparison */
#define LT < /* less than value comparison */
#define LE <= /* less than or equal to value comparison */
#define GT > /* greater than value comparison */
#define GE >= /* greater than or equal to comparison */
/* Bitwise operators */
#define BITAND & /* bitwise AND */
#define BITOR | /* bitwise OR */
#define BITXOR ^ /* bitwise exclusive OR */
#define BITNOT ~ /* bitwise NOT */
#define LSHF << /* left shift */
#define RSHF >> /* right shift */
/* Arithmetic operators */
#define INC ++ /* increment */
#define DEC -- /* decrement */
#define MOD % /* modulo division */
/* IF_THEN_ELIF_ELSE construct */
#define IF(e) { if (e) /* if statement */
#define THEN { /* then statement */
#define ELIF(e) } else if (e) { /* elseif statement */
#define ELSE } else { /* else statement */
#define ENDIF ; } } /* end of if statement */
/* CASE construct */
#define CASE(e) { switch (e) { /* case statement */
#define WHEN(e) case e: { /* case block */
#define ENDWHEN } break; /* end of case block */
#define OTHERWISE default: { /* default case block */
#define ENDCASE } } /* end of case */
/* WHILE construct */
#define WHILE(e) { while (e) { /* while statement */
#define ENDWHILE ; } } /* end of while statement */
/* REPEAT construct */
#define REPEAT { do { /* repeat statement */
#define UNTIL(e) ; } while (!(e)); } /* end of repeat statement */
/* FOR construct */
#define FOR(e) { for (e) { /* for statement */
#define ENDFOR ; } } /* end of for statement */
/* BEGIN_END construct */
#define BEGIN { /* beginning of block */
#define END } /* end of block */